﻿using System.Collections.Generic;
using System.Linq;
using System.Windows.Media;


namespace _3DTicTacToe
{
    sealed class BrushList : List<string>
    {
        private static readonly IEnumerable<string> Brushes;
        static BrushList()
        {
            var brushesType = typeof(Brushes);
            var brushesProperty = brushesType.GetProperties();
            var brushConverter = new BrushConverter();

            var brushNames = brushesProperty.Select(p => p.Name);

            Brushes = from bname in brushNames
                      let brush = brushConverter.ConvertFromString(bname) as SolidColorBrush
                      let sum = brush.Color.R + brush.Color.G + brush.Color.B
                      where sum < 650 && sum > 100
                      orderby bname
                      select bname;
        }

        public BrushList()
        {
            AddRange(Brushes);
        }
    }
}
